import org.apache.spark.SparkConf

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object UV {
  def main(args:Array[String]) : Unit = {
    val sparkConf = new SparkConf().setAppName("UV").setMaster("local[2]")

    val sc = new SparkContext(sparkConf)

    val data : RDD[String] = sc.textFile("data/access.log")

    val ips = data.map(x => x.split(" ")(0))

    val uv = ips.distinct().count()

    print("UV:"+uv)
  }
}
